package com.lancoo.cvas.interceptor;

import cn.hutool.core.util.StrUtil;
import com.lancoo.cvas.service.TeachingClassWeekService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author: liufeng
 * @CreateTime: 2024-04-10  10:47
 * @Description: 同步课表到基础平台时  判断学期
 */
@Component
@Slf4j
public class ScheduleStatueInterceptor implements HandlerInterceptor {
    @Resource
    private TeachingClassWeekService teachingClassWeekService;

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if (!(handler instanceof HandlerMethod)){
            return true;
        }
//        String taskId = request.getHeader("taskId");
//        if (StrUtil.isNotEmpty(taskId)){
//            teachingClassWeekService.removeUnSuit(Integer.valueOf(taskId));
//        }


        return true;
    }
}
